#ifndef __QUEUE_H__
#define __QUEUE_H__

//define stack return code
#define QUEUE_OK        0
#define QUEUE_FULL      -1
#define QUEUE_EMPTY     -2
#define QUEUE_FAIL      -3



struct queue {
    void **elements;
    unsigned int capacity; //sizeof elements
    unsigned int size;  // number node in queue
    int front;  // 
};

typedef struct queue queue_t;


//interface (operation of queue)

int init(queue_t *, int capacity); // return QUEUE_FAIL if malloc error
int enqueue(queue_t *, void*);   //return QUEUE_FULL if error
void * dequeue(queue_t *); 

int isFULL(queue_t *);  //return 1 if queue is full
int isEmpty(queue_t *); // return 1 if queue is empty
// return 1 if x is contained in stack
int isExist(queue_t *queuePtr, void* key, int (*compare)(void *node, void *key));
void freeQueue(queue_t *);

#endif